package cn.txun.springboot61.mapper;

import cn.txun.springboot61.entity.Comment;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CommentMapper {
    @Insert("insert into comment values(null,#{content}," +
            "#{author},#{created},#{weiboId})")
    int insert(Comment comment);
    @Select("select id,content,author from comment where weibo_id=#{id}")
    List<Comment> selectByWeiboId(int id);
}
